detectOrient()
window.onresize = function() {
  detectOrient()
}
// 判断横屏竖屏  相当于媒体查询
function detectOrient() {
  const width = document.documentElement.clientWidth
  const height = document.documentElement.clientHeight
  const deviceWidth = width < 320 ? 320 : width // > 750 ? 750 : width
  const deviceHeight = height < 320 ? 320 : height // > 750 ? 750 : width
  if (width <= height) { // 竖屏
    document.documentElement.style.fontSize = deviceWidth / 7.5 + 'px'
  } else { // 横屏
    document.documentElement.style.fontSize = deviceHeight / 7.5 + 'px'
  }
}
